package com.zbkj.service.assistant.dao;

import com.zbkj.common.dto.KeyNumDto;
import com.zbkj.common.model.assistant.AssistantConversation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbkj.service.assistant.model.request.AssistantConversationHistorySearchRequest;
import com.zbkj.service.assistant.model.vo.AssistantConversationVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 客服会话表 Mapper 接口
 * </p>
 *
 * @author keNan
 * @since 2025-06-11
 */
public interface AssistantConversationDao extends BaseMapper<AssistantConversation> {

    List<KeyNumDto> getCurrentServiceConversationCount();

    /**
     * 更新会话的消息发送数量
     * @param id 会话id
     * @param userCount 增加用户发送的消息数
     * @param serviceCount 增加客服发送的消息数
     */
    void updateMsgCount(@Param("id") Integer id, @Param("userCount") Integer userCount, @Param("serviceCount") Integer serviceCount);

    List<AssistantConversationVO> findHistoryList(AssistantConversationHistorySearchRequest request);
}
